package com.example.mallcoupon.feign;


import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

@Slf4j
@Component
public class MemberFallbackFactory implements FallbackFactory<MemberFeignService> {

	@Override
	public MemberFeignService create(Throwable throwable) {
		return new MemberFeignService() {
			@Override
			public String memberFeignTest() {
				log.error("查询用户异常"); // 可以返回异常
				return "查询异常";   // 自己想要返回啥就返回啥
			}

			@Override
			public Boolean saveFeign() {
				return false;
			}
		};
	}
}